﻿// =================================================================== 
// 项目说明
//====================================================================
// lsc @Copy Right 2019
// 文件： CarSerialRepository.cs
// 项目名称：斑马车务
// 创建时间：2019-12-11
// 负责人：lsc
// ===================================================================
using System;
using System.Text;
using System.Collections.Generic;
using CRM.Infrastructure.Entity;

namespace CRM.Infrastructure.Repository
{
	/// <summary>
	/// 仓储层
	/// </summary>	
	public class CarSerialRepository:BaseRepository<CarSerial>
	{		
    
        #region 构造

        public CarSerialRepository() : base(){}

        public CarSerialRepository(string connectionString) : base(connectionString){}

        public CarSerialRepository(DatabaseContext dbContext) : base(dbContext){}

        #endregion

        /// <summary>
        /// 根据品牌ID获取车型列表
        /// </summary>
        /// <param name="BrandID"></param>
        /// <returns></returns>

        public List<CarSerial> GetSerialListByBrandId(int BrandID)
        {
            StringBuilder sb = new StringBuilder("SELECT * FROM CarSerial WITH(NOLOCK) ");
            sb.Append(" WHERE BrandID=@BrandID ORDER BY SerialID DESC");
            return Query(sb.ToString(), new { BrandID = BrandID });
        }

    }
}